package com.mou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.mou.dto.ProductPageQueryDTO;
import com.mou.dto.ProductSearchDTO;
import com.mou.entity.Product;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ProductMapper extends BaseMapper<Product> {
    Page<Product> pageQuery(ProductPageQueryDTO productPageQueryDTO);

    @Select("select * from product where status = 0 order by create_time desc ")
    List<Product> getList();

    List<Product> search(ProductSearchDTO productSearchDTO);


    void add(Product product);

    List<Product> getByUserId(Integer userId);
}
